<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href='<?php echo base_url()?>'>
<link rel="stylesheet" type="text/css" href="public/common/css/common.css"/>
<link rel="stylesheet" type="text/css" href="public/admin/css/admin.css"/>
<script src="public/common/js/jquery.js"></script>
<script>
$(function(){
	var privilege		= '<?php echo json_encode(unserialize($group->group_privilege))?>';
	privilege			= eval('('+privilege+')');
	for(i in privilege)
	{
		if(i == 'all')
		{
			$('.table input:checkbox').attr('checked',true);
			$('.table input:checkbox:gt(0)').attr('disabled',true);
			return;
		}else{
			for(c in privilege[i])
			{
				$('input[name="group_privilege['+i+'][]"]').eq(c).attr('checked',true);
			}
		}	
	}
});
function select_all(obj)
{
	if(obj.checked == true)
	{
		$('.table input:checkbox:gt(0)').attr('checked',true).attr('disabled',true);
	}else{
		$('.table input:checkbox:gt(0)').attr('checked',false).attr('disabled',false);
	}
}
function select_children(obj)
{
	if(obj.checked == true)
	{
		$(obj).parent().parent().find('input:checkbox:gt(0)').attr('checked',true);
	}else{
		$(obj).parent().parent().find('input:checkbox:gt(0)').attr('checked',false);
	}
}
</script>
</head>
<body>
<div class="body">
	<div class="main_top"><div class="position left">当前位置 <span>&gt;</span> 用户 <span>&gt;</span> 管理员 <span>&gt;</span> 管理员分组 <span>&gt;</span> 修改分组 </div></div>
    <div class="go_back"><a href="javascript:history.back()">返回</a></div>
    <div class="body_center">
    	<form action="<?php echo site_url('admin/user_admin/edit_group')?>" method="post">
            <!-- 基本设置 start -->
            <table class="table">
                <tr><th width='20%'>参数名</th><th width='55%'>参数值</th><th width='25%'>参数说明</th></tr>
                <tr>
                    <td align="center">分组名称：</td>
                    <td><input class="input_txt" type="text" name="group_name" value="<?php echo $group->group_name?>" /></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td align="center">管理组描述：</td>
                    <td><textarea name="group_desc" class="textarea"><?php echo $group->group_desc?></textarea></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td align="center">权限设置：</td>
                    <td><input type="checkbox" onclick="select_all(this)" name="group_privilege[all]" value='all' />全部权限</td>
                    <td>&nbsp;</td>
                </tr>
                <tr> 
                    <td align="center"><input type="checkbox" onclick='select_children(this)' /> 网站设置：</td>
                    <td colspan="2">
                    	<input type="checkbox" name="group_privilege[system][]" value="site" />站点配置查看 
						<input type="checkbox" name="group_privilege[system][]" value="update_site_config" />站点配置修改
                        <input type="checkbox" name="group_privilege[system][]" value="sys" />系统配置查看
						<input type="checkbox" name="group_privilege[system][]" value="update_sys_config" />系统配置修改
                    </td>
                </tr>
                <tr>
                    <td align="center"><input type="checkbox" onclick='select_children(this)' /> 客服设置：</td>
                    <td colspan="2">
                    	<input type="checkbox" name="group_privilege[kefu][]" value="index" />客服查看
                        <input type="checkbox" name="group_privilege[kefu][]" value="add_kefu" />添加客服
                        <input type="checkbox" name="group_privilege[kefu][]" value="update_kefu" />编辑客服
                        <input type="checkbox" name="group_privilege[kefu][]" value="delete" />删除客服
                    </td>
                </tr>
                <tr>
                    <td align="center"><input type="checkbox" onclick='select_children(this)' /> 广告设置：</td>
                    <td colspan="2">
                    	<input type="checkbox" name="group_privilege[ad][]" value="index" />广告查看
                        <input type="checkbox" name="group_privilege[ad][]" value="add_ad" />添加广告
                        <input type="checkbox" name="group_privilege[ad][]" value="edit_ad" />编辑广告
                        <input type="checkbox" name="group_privilege[ad][]" value="delete_ad" />删除广告
						<input type="checkbox" name="group_privilege[ad][]" value="config" />广告设置查看
                        <input type="checkbox" name="group_privilege[ad][]" value="update_config" />广告设置修改
                        <input type="checkbox" name="group_privilege[ad][]" value="category" />广告分类查看
                        <input type="checkbox" name="group_privilege[ad][]" value="add_category" />新增广告分类
                        <input type="checkbox" name="group_privilege[ad][]" value="update_category" />修改广告分类
                        <input type="checkbox" name="group_privilege[ad][]" value="delete_category" />删除广告分类
                    </td>
                </tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 栏目设置：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[category][]" value="index" />栏目查看
						<input type="checkbox" name="group_privilege[category][]" value="add_category" />新增栏目
						<input type="checkbox" name="group_privilege[category][]" value="edit_category" />修改栏目
						<input type="checkbox" name="group_privilege[category][]" value="move_category" />移动栏目
						<input type="checkbox" name="group_privilege[category][]" value="delete_category" />删除栏目
					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 模型设置：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[model][]" value="index" />模型查看
						<input type="checkbox" name="group_privilege[model][]" value="add_model" />新增模型
					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 文章模块：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[article][]" value="index" />文章查看
						<input type="checkbox" name="group_privilege[article][]" value="add_article" />新增文章
						<input type="checkbox" name="group_privilege[article][]" value="edit_article" />编辑文章
						<input type="checkbox" name="group_privilege[article][]" value="delete_article" />删除文章
					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 产品模块：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[product][]" value="index" />产品查看
						<input type="checkbox" name="group_privilege[product][]" value="add_product" />新增产品
						<input type="checkbox" name="group_privilege[product][]" value="edit_product" />编辑产品
						<input type="checkbox" name="group_privilege[product][]" value="delete_product" />删除产品
					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 下载模块：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[download][]" value="index" />下载查看
						<input type="checkbox" name="group_privilege[download][]" value="index" />新增下载
						<input type="checkbox" name="group_privilege[download][]" value="index" />编辑下载
						<input type="checkbox" name="group_privilege[download][]" value="index" />删除下载
					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 招聘模块：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[job][]" value="index" />招聘查看
						<input type="checkbox" name="group_privilege[job][]" value="add_job" />新增招聘
						<input type="checkbox" name="group_privilege[job][]" value="edit_job" />编辑招聘
						<input type="checkbox" name="group_privilege[job][]" value="delete_job" />删除招聘
					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 单页模块：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[alone][]" value="index" />单页查看
						<input type="checkbox" name="group_privilege[alone][]" value="add_content" />新增单页
						<input type="checkbox" name="group_privilege[alone][]" value="edit_content" />编辑单页
						<input type="checkbox" name="group_privilege[alone][]" value="delete_content" />删除单页
					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 片段模块：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[block][]" value="index" />片段查看
						<input type="checkbox" name="group_privilege[block][]" value="add_content" />新增片段
						<input type="checkbox" name="group_privilege[block][]" value="edit_content" />编辑片段
						<input type="checkbox" name="group_privilege[block][]" value="delete_content" />删除片段
					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 产品咨询：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[ad][]" value="index" />咨询查看
						<input type="checkbox" name="group_privilege[ad][]" value="index" />回复咨询
						<input type="checkbox" name="group_privilege[ad][]" value="index" />删除咨询
					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 网站留言：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[ad][]" value="index" />留言查看
						<input type="checkbox" name="group_privilege[ad][]" value="index" />回复留言
						<input type="checkbox" name="group_privilege[ad][]" value="index" />删除留言
						<input type="checkbox" name="group_privilege[ad][]" value="index" />留言配置

					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 会员管理：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[user][]" value="index" />会员查看
						<input type="checkbox" name="group_privilege[user][]" value="index" />新增会员
						<input type="checkbox" name="group_privilege[user][]" value="index" />编辑会员
						<input type="checkbox" name="group_privilege[user][]" value="index" />删除会员

					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 管理管理：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[user_admin][]" value="index" />管理员查看
						<input type="checkbox" name="group_privilege[user_admin][]" value="index" />新增管理员
						<input type="checkbox" name="group_privilege[user_admin][]" value="index" />编辑管理员
						<input type="checkbox" name="group_privilege[user_admin][]" value="index" />删除管理员
						<input type="checkbox" name="group_privilege[user_admin][]" value="index" />查看管理分组
						<input type="checkbox" name="group_privilege[user_admin][]" value="index" />新增管理分组
					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 友情链接：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[friend_link][]" value="index" />链接查看
						<input type="checkbox" name="group_privilege[friend_link][]" value="index" />新增链接
						<input type="checkbox" name="group_privilege[friend_link][]" value="index" />编辑链接
						<input type="checkbox" name="group_privilege[friend_link][]" value="index" />删除链接
					</td>
				</tr>
				<tr>
					<td align="center"><input type="checkbox" onclick='select_children(this)' /> 数据备份：</td>
					<td colspan="2">
						<input type="checkbox" name="group_privilege[ad][]" value="index" />备份数据
						<input type="checkbox" name="group_privilege[ad][]" value="index" />恢复数据
					</td>
				</tr>
        		<tr>
                    <td align="center" colspan="2">
						<input type=hidden value="<?php echo $group->group_id?>" name='group_id'>
                   		<input type="submit" class="submit" value="修改" /> 
                        &nbsp;&nbsp;
                        <input type="reset" class="reset" value="重置" />
                    </td>
                    <td>&nbsp;</td>
                </tr>
            </table>
            <!-- 高级设置 end -->
   		</form>
    </div>
</div>
</body>
</html>